package com.dodayum.java8;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;

/**
 * @author BaiYu
 * @date 2023/8/219:27
 */
public class TimeDemo {

    public static void main(String[] args) {
        LocalDateTime localDateTime = LocalDateTime.now().minusMinutes(2);
        Date date = Date.from(LocalDateTime.now().minusMinutes(2).atZone(ZoneId.systemDefault()).toInstant());
        System.out.println(date);
    }

}
